﻿// MIT License
// 开源地址：https://gitee.com/co1024/AbcMvc
// Copyright (c) 2021-2023 1024
// Abc.Mvc=Furion+EF+SqlSugar+Pear layui admin.

namespace Abc.Application.HtAdminServices;

/// <summary>
/// 开发者服务，方便操作用
/// </summary>
public interface IDeveloperService
{
    /// <summary>
    /// 更新菜单功能权限
    /// </summary>
    /// <returns></returns>
    Task UpdateMenuPermission(bool isThrowEx = true);

    /// <summary>
    /// 删除数据库所有菜单
    /// </summary>
    /// <returns></returns>
    Task DeleteDbAllMenu();

    /// <summary>
    /// RSA 加密解密验证
    /// </summary>
    /// <param name="publicKey">公钥</param>
    /// <param name="privateeKey">私钥</param>
    /// <returns></returns>
    bool RsaVer(string publicKey, string privateeKey);

    // 生成模板代码
    void GenerateCode(CG_CodeGenerateConfig config);

    /// <summary>
    /// 数据库差异对比
    /// </summary>
    /// <param name="config">数据库配置</param>
    /// <returns></returns>
    string DbDifferenceTables(SqlSugarDbTableConfig config);

    /// <summary>
    /// 更新数据库表
    /// </summary>
    /// <param name="config">数据库配置</param>
    /// <returns></returns>
    string InitTables(SqlSugarDbTableConfig config);

    /// <summary>
    /// 创建数据库
    /// </summary>
    /// <param name="config">数据库配置</param>
    /// <returns></returns>
    string CreateDb(SqlSugarDbTableConfig config);
    /// <summary>
    /// 保存数据库配置
    /// </summary>
    /// <param name="config">数据库配置</param>
    /// <returns></returns>
    string SaveDbConfig(SqlSugarDbTableConfig config);

    /// <summary>
    /// 更新数据种子
    /// </summary>
    /// <param name="config">数据库配置</param>
    /// <returns></returns>
    string UpdateDataSeed(SqlSugarDbTableConfig config);
}